package com.itheima.manager;

import com.itheima.domain.OrderSetting;
import com.itheima.service.IOrderSettingService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

@Component
public class OrderSettingManager {

    @DubboReference
    private IOrderSettingService orderSettingService;

    //修改指定订单设置
    public Integer update(Integer id, OrderSetting orderSetting) {
        //1、调用API，修改指定订单设置
        orderSetting.setId(id.longValue());
        return orderSettingService.update(orderSetting);
    }

    //获取指定订单设置
    public OrderSetting findById(Integer id) {
        return orderSettingService.findById(id.longValue());
    }
}
